// -*- c++ -*-

namespace std {
  template <class C> auto begin(C& c) -> decltype(c.begin())
  {
    return c.begin();
  }

  template <class C> auto begin(const C& c) -> decltype(c.begin())
  {
    return c.begin();
  }

  template <class C> auto end(C& c) -> decltype(c.end())
  {
    return c.end();
  }

  template <class C> auto end(const C& c) -> decltype(c.end())
  {
    return c.end();
  }

  template <class T, size_t N> T* begin(T (&array)[N])
  {
    return &array[0];
  }

  template <class T, size_t N> T* end(T (&array)[N])
  {
    return &array[N];
  }
}
